"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const child_process_1 = require("child_process");
const configTool_1 = __importDefault(require("../../com/configTool"));
const path_1 = __importDefault(require("path"));
const getMemoryUsage = async () => {
    const scriptPath = path_1.default.join(configTool_1.default.wwwPath, '/dll/logMemoryUsage.js');
    const command = 'node ' + scriptPath;
    return new Promise((resolve, reject) => {
        (0, child_process_1.exec)(command, { maxBuffer: 1024 * 1000 * 10 }, (error, stdout, stderr) => {
            if (error) {
                console.error(`getDeviceList 错误: ${error.message}`);
                return null;
            }
            if (stderr) {
                console.error(`stderr: ${stderr}`);
                return null;
            }
            resolve(JSON.parse(stdout));
        });
    });
};
exports.default = getMemoryUsage;
